{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "source": [
    "# PlantUMLのインストール"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "plantuml.jar\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "\n",
    "### PlantUMLインストール(Ubuntu16.04)\n",
    "### ※ Javaはインストール済みの前提\n",
    "#sudo apt-get install -y graphviz doxygen\n",
    "\n",
    "### Mac\n",
    "# brew install graphviz\n",
    "\n",
    "### plantuml.jarはググってダウンロードする\n",
    "ls plantuml.jar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": [
    "%%bash\n",
    "\n",
    "current_dir=`pwd`\n",
    "\n",
    "### サンプルコードの作成\n",
    "cat <<- EOS > ${current_dir}/plantuml/sample.pu\n",
    "@startuml\n",
    "skinparam classAttributeIconSize 0\n",
    "\n",
    "interface Printable {\n",
    "    {abstract} void print()\n",
    "    {abstract} void newPage()\n",
    "}\n",
    "\n",
    "class PrintClass {\n",
    "    void print()\n",
    "    void newPage()\n",
    "}\n",
    "\n",
    "Printable <|.. PrintClass\n",
    "@enduml\n",
    "EOS\n",
    "\n",
    "### サンプルコードからUMLの図を作成\n",
    "java -jar plantuml.jar -o ${current_dir}/img -tpng ${current_dir}/plantuml/sample.pu"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "## 画像の確認\n",
    "\n",
    "<img src=\"img/sample.png\" alt=\"サンプルクラス図\" title=\"サンプルクラス図\" width=\"100\" height=\"50\" align=\"left\" />  \n",
    "<br clear=\"left\">\n",
    "\n",
    "### タグの書き方\n",
    "\n",
    "```\n",
    "<img src=\"img/sample.png\" alt=\"サンプルクラス図\" title=\"サンプルクラス図\" width=\"100\" height=\"50\" align=\"left\" />  \n",
    "<br clear=\"left\">\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
